import {RouteRecordRaw} from 'vue-router'

declare module 'vue-router' {
    interface RouteMeta {
        // 是可选的
        isIframe?: boolean,
        isLink?: boolean
        title?: string
    }
}
export const notFoundAndNoPowerRoutes = [
    {
        path: '/:path(.*)*',
        name: 'notFound',
        component: () => import('@/views/error/404.vue')
    }
];
export const routes = [
    {
        path: '/',
        name: '/',
        redirect: '/home',
        component: () => import('@/layout/index.vue'),
        children: [
            {
                path: '/home',
                name: 'home',
                component: () => import('@/views/home/index.vue'),
                meta: {
                    title: '首页',
                    isLink: false,
                    isIframe: false
                }
            },
            {
                path: '/blog',
                name: 'blog',
                meta: {
                    title: '博客',
                    isLink: false,
                    isIframe: false
                },
                children: [
                    {
                        path: '/blog/article',
                        name: 'article',
                        component: () => import('@/views/blog/article.vue'),
                        meta: {
                            title: '文章',
                            isLink: false,
                            isIframe: false
                        }
                    },
                    {
                        path: '/blog/category',
                        name: 'category',
                        component: () => import('@/views/blog/category.vue'),
                        meta: {
                            title: '栏目',
                            isLink: false,
                            isIframe: false
                        },
                    }
                ]
            },
            {
                path: '/editor',
                name: 'editor',
                meta: {
                    title: '富文本',
                    isLink: false,
                    isIframe: false
                },
                children: [
                    {
                        path: '/editor/wangEditor',
                        name: 'wangEditor',
                        component: () => import('@/views/editor/wangEditor.vue'),
                        meta: {
                            title: '王Editor',
                            isLink: false,
                            isIframe: false
                        }
                    },
                ]
            },

            {
                path: '/logicFlow',
                name: 'logicFlow',
                meta: {
                    title: '流程图',
                    isLink: false,
                    isIframe: false
                },
                children: [
                    {
                        path: '/logicFlow/process',
                        name: 'process',
                        component: () => import('@/views/logicFlow/process.vue'),
                        meta: {
                            title: 'logicFlow',
                            isLink: false,
                            isIframe: false
                        }
                    },
                ]
            },
            // {
            //     path: '/iframesOne',
            //     name: 'layoutIframeViewOne',
            //     component: () => import('/@/layout/routerView/iframes.vue'),
            //     meta: {
            //         title: 'message.router.layoutIframeViewOne',
            //         isLink: 'https://nodejs.org/zh-cn/',
            //         isHide: false,
            //         isKeepAlive: true,
            //         isAffix: true,
            //         isIframe: true,
            //         roles: ['admin'],
            //         icon: 'iconfont icon-neiqianshujuchucun',
            //     },
            // }
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login/index.vue')
    }
] as RouteRecordRaw[]
